<?php
/**
 * CreateTime: 2023/12/27 15:07
 * User:LinQ
 */

namespace App\Http\Requests\Client;

use App\Http\Requests\BasicFormRequests;

class ClientRequest  extends BasicFormRequests
{
    protected $rule =[
        'client_name' => 'required',
        'client_code' => 'required'
    ];

    public function __construct(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
    {
        $this->message = [
            'client_name.required'=> trans('message.request_required',[
                'name' => trans('key.client')
            ]),
            'client_code.required'=> trans('message.request_required',[
                'name'  => trans('key.client_code')
            ])
        ];
        parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);
    }


    protected $scene = [
        'add' => ['client_name','client_code'],
        'update' => ['client_name']
    ];

}
